package com.atguigu.springcloud.config;


import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @ClassName: cloud2020
 * @description:
 * @author: zxf
 * @create: 2021-06-15 19:28
 **/
@Configuration
public class ApplicationContextConfig {

    // 注解的方式注入restTemplate到IOC容器中

    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }



}

